package com.ma.table.actors;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.ma.logica.Assets;

public class Coin extends Actor{
    TextureRegion regionCoin, regionDiamante, regionFinal;
    Texture coinTexture, diamanteTexture;
    private boolean diamante = false;

	public Coin(){        
        coinTexture = Assets.instance.images.coinTexture;
        diamanteTexture = Assets.instance.images.diamanteTexture;
        regionCoin = new TextureRegion(coinTexture);
        regionDiamante = new TextureRegion(diamanteTexture);
        
    }
    
    @Override
    public void draw(Batch batch,float parentAlpha){
    	if(isDiamante()){
    		regionFinal = regionDiamante;
    	}else {
			regionFinal = regionCoin;
		}
    	batch.draw(regionFinal, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation());
        batch.flush();   
    }
    
    @Override
    public void act(float delta){
    	super.act(delta);
    }

	public boolean isDiamante() {
		return diamante;
	}

	public void setDiamante(boolean diamante) {
		this.diamante = diamante;
	}
    
    

}